3.575 \(\int (a+b \sin ^n(c+d x))^2 \tan ^m(c+d x) \, dx\)
Optimal. Leaf size=215 \[ \frac {a^2 \tan ^{m+1}(c+d x) \, _2F_1\left (1,\frac {m+1}{2};\frac {m+3}{2};-\tan ^2(c+d x)\right )}{d (m+1)}+\frac {2 a b \cos ^2(c+d x)^{\frac {m+1}{2}} \tan ^{m+1}(c+d x) \sin ^n(c+d x) \, _2F_1\left (\frac {m+1}{2},\frac {1}{2} (m+n+1);\frac {1}{2} (m+n+3);\sin ^2(c+d x)\right )}{d (m+n+1)}+\frac {b^2 \cos ^2(c+d x)^{\frac {m+1}{2}} \tan ^{m+1}(c+d x) \sin ^{2 n}(c+d x) \, _2F_1\left (\frac {m+1}{2},\frac {1}{2} (m+2 n+1);\frac {1}{2} (m+2 n+3);\sin ^2(c+d x)\right )}{d (m+2 n+1)} \]
[Out]
a^2*hypergeom([1, 1/2+1/2*m],[3/2+1/2*m],-tan(d*x+c)^2)*tan(d*x+c)^(1+m)/d/(1+m)+2*a*b*(cos(d*x+c)^2)^(1/2+1/2
*m)*hypergeom([1/2+1/2*m, 1/2+1/2*m+1/2*n],[3/2+1/2*m+1/2*n],sin(d*x+c)^2)*sin(d*x+c)^n*tan(d*x+c)^(1+m)/d/(1+
m+n)+b^2*(cos(d*x+c)^2)^(1/2+1/2*m)*hypergeom([1/2+1/2*m, 1/2+1/2*m+n],[3/2+1/2*m+n],sin(d*x+c)^2)*sin(d*x+c)^
(2*n)*tan(d*x+c)^(1+m)/d/(1+m+2*n)
________________________________________________________________________________________
Rubi [A] time = 0.30, antiderivative size = 215, normalized size of antiderivative = 1.00,
number of steps used = 8, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used =
{3234, 3476, 364, 2602, 2577} \[ \frac {a^2 \tan ^{m+1}(c+d x) \, _2F_1\left (1,\frac {m+1}{2};\frac {m+3}{2};-\tan ^2(c+d x)\right )}{d (m+1)}+\frac {2 a b \cos ^2(c+d x)^{\frac {m+1}{2}} \tan ^{m+1}(c+d x) \sin ^n(c+d x) \, _2F_1\left (\frac {m+1}{2},\frac {1}{2} (m+n+1);\frac {1}{2} (m+n+3);\sin ^2(c+d x)\right )}{d (m+n+1)}+\frac {b^2 \cos ^2(c+d x)^{\frac {m+1}{2}} \tan ^{m+1}(c+d x) \sin ^{2 n}(c+d x) \, _2F_1\left (\frac {m+1}{2},\frac {1}{2} (m+2 n+1);\frac {1}{2} (m+2 n+3);\sin ^2(c+d x)\right )}{d (m+2 n+1)} \]
Antiderivative was successfully verified.
[In]
Int[(a + b*Sin[c + d*x]^n)^2*Tan[c + d*x]^m,x]
[Out]
(a^2*Hypergeometric2F1[1, (1 + m)/2, (3 + m)/2, -Tan[c + d*x]^2]*Tan[c + d*x]^(1 + m))/(d*(1 + m)) + (2*a*b*(C
os[c + d*x]^2)^((1 + m)/2)*Hypergeometric2F1[(1 + m)/2, (1 + m + n)/2, (3 + m + n)/2, Sin[c + d*x]^2]*Sin[c +
d*x]^n*Tan[c + d*x]^(1 + m))/(d*(1 + m + n)) + (b^2*(Cos[c + d*x]^2)^((1 + m)/2)*Hypergeometric2F1[(1 + m)/2,
(1 + m + 2*n)/2, (3 + m + 2*n)/2, Sin[c + d*x]^2]*Sin[c + d*x]^(2*n)*Tan[c + d*x]^(1 + m))/(d*(1 + m + 2*n))
Rule 364
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(a^p*(c*x)^(m + 1)*Hypergeometric2F1[-
p, (m + 1)/n, (m + 1)/n + 1, -((b*x^n)/a)])/(c*(m + 1)), x] /; FreeQ[{a, b, c, m, n, p}, x] && !IGtQ[p, 0] &&
(ILtQ[p, 0] || GtQ[a, 0])
Rule 2577
Int[(cos[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[(b^(2*IntPart
[(n - 1)/2] + 1)*(b*Cos[e + f*x])^(2*FracPart[(n - 1)/2])*(a*Sin[e + f*x])^(m + 1)*Hypergeometric2F1[(1 + m)/2
, (1 - n)/2, (3 + m)/2, Sin[e + f*x]^2])/(a*f*(m + 1)*(Cos[e + f*x]^2)^FracPart[(n - 1)/2]), x] /; FreeQ[{a, b
, e, f, m, n}, x]
Rule 2602
Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[(a*Cos[e + f
*x]^(n + 1)*(b*Tan[e + f*x])^(n + 1))/(b*(a*Sin[e + f*x])^(n + 1)), Int[(a*Sin[e + f*x])^(m + n)/Cos[e + f*x]^
n, x], x] /; FreeQ[{a, b, e, f, m, n}, x] && !IntegerQ[n]
Rule 3234
Int[((a_) + (b_.)*((c_.)*sin[(e_.) + (f_.)*(x_)])^(n_))^(p_.)*((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol]
:> Int[ExpandTrig[(d*tan[e + f*x])^m*(a + b*(c*sin[e + f*x])^n)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n},
x] && IGtQ[p, 0]
Rule 3476
Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[b/d, Subst[Int[x^n/(b^2 + x^2), x], x, b*Tan[c + d
*x]], x] /; FreeQ[{b, c, d, n}, x] && !IntegerQ[n]
Rubi steps
\begin {align*} \int \left (a+b \sin ^n(c+d x)\right )^2 \tan ^m(c+d x) \, dx &=\int \left (a^2 \tan ^m(c+d x)+2 a b \sin ^n(c+d x) \tan ^m(c+d x)+b^2 \sin ^{2 n}(c+d x) \tan ^m(c+d x)\right ) \, dx\\ &=a^2 \int \tan ^m(c+d x) \, dx+(2 a b) \int \sin ^n(c+d x) \tan ^m(c+d x) \, dx+b^2 \int \sin ^{2 n}(c+d x) \tan ^m(c+d x) \, dx\\ &=\frac {a^2 \operatorname {Subst}\left (\int \frac {x^m}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}+\left (2 a b \cos ^{1+m}(c+d x) \sin ^{-1-m}(c+d x) \tan ^{1+m}(c+d x)\right ) \int \cos ^{-m}(c+d x) \sin ^{m+n}(c+d x) \, dx+\left (b^2 \cos ^{1+m}(c+d x) \sin ^{-1-m}(c+d x) \tan ^{1+m}(c+d x)\right ) \int \cos ^{-m}(c+d x) \sin ^{m+2 n}(c+d x) \, dx\\ &=\frac {a^2 \, _2F_1\left (1,\frac {1+m}{2};\frac {3+m}{2};-\tan ^2(c+d x)\right ) \tan ^{1+m}(c+d x)}{d (1+m)}+\frac {2 a b \cos ^2(c+d x)^{\frac {1+m}{2}} \, _2F_1\left (\frac {1+m}{2},\frac {1}{2} (1+m+n);\frac {1}{2} (3+m+n);\sin ^2(c+d x)\right ) \sin ^n(c+d x) \tan ^{1+m}(c+d x)}{d (1+m+n)}+\frac {b^2 \cos ^2(c+d x)^{\frac {1+m}{2}} \, _2F_1\left (\frac {1+m}{2},\frac {1}{2} (1+m+2 n);\frac {1}{2} (3+m+2 n);\sin ^2(c+d x)\right ) \sin ^{2 n}(c+d x) \tan ^{1+m}(c+d x)}{d (1+m+2 n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 15.37, size = 2368, normalized size = 11.01 \[ \text {Result too large to show} \]
Warning: Unable to verify antiderivative.
[In]
Integrate[(a + b*Sin[c + d*x]^n)^2*Tan[c + d*x]^m,x]
[Out]
(2*(Cos[c + d*x]*Sec[(c + d*x)/2]^2)^m*((a^2*AppellF1[(1 + m)/2, m, 1, (3 + m)/2, Tan[(c + d*x)/2]^2, -Tan[(c
+ d*x)/2]^2])/(1 + m) + b*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n*((2*a*AppellF1[(1 + m + n)/2, m, 1 + n, (3 + m
+ n)/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2])/(1 + m + n) + (b*AppellF1[1/2 + m/2 + n, m, 1 + 2*n, 3/2 +
m/2 + n, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n)/(1 + m + 2*n)))*Tan[(
c + d*x)/2]*Tan[c + d*x]^m*(a^2*Tan[c + d*x]^m + 2*a*b*Sin[c + d*x]^n*Tan[c + d*x]^m + b^2*Sin[c + d*x]^(2*n)*
Tan[c + d*x]^m))/(d*(2*m*(Cos[c + d*x]*Sec[(c + d*x)/2]^2)^m*Sec[c + d*x]^2*((a^2*AppellF1[(1 + m)/2, m, 1, (3
+ m)/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2])/(1 + m) + b*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n*((2*a*App
ellF1[(1 + m + n)/2, m, 1 + n, (3 + m + n)/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2])/(1 + m + n) + (b*Appel
lF1[1/2 + m/2 + n, m, 1 + 2*n, 3/2 + m/2 + n, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*(Sec[(c + d*x)/2]^2)^n*
Sin[c + d*x]^n)/(1 + m + 2*n)))*Tan[(c + d*x)/2]*Tan[c + d*x]^(-1 + m) + Sec[(c + d*x)/2]^2*(Cos[c + d*x]*Sec[
(c + d*x)/2]^2)^m*((a^2*AppellF1[(1 + m)/2, m, 1, (3 + m)/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2])/(1 + m)
+ b*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n*((2*a*AppellF1[(1 + m + n)/2, m, 1 + n, (3 + m + n)/2, Tan[(c + d*x
)/2]^2, -Tan[(c + d*x)/2]^2])/(1 + m + n) + (b*AppellF1[1/2 + m/2 + n, m, 1 + 2*n, 3/2 + m/2 + n, Tan[(c + d*x
)/2]^2, -Tan[(c + d*x)/2]^2]*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n)/(1 + m + 2*n)))*Tan[c + d*x]^m + 2*m*(Cos[
c + d*x]*Sec[(c + d*x)/2]^2)^(-1 + m)*((a^2*AppellF1[(1 + m)/2, m, 1, (3 + m)/2, Tan[(c + d*x)/2]^2, -Tan[(c +
d*x)/2]^2])/(1 + m) + b*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n*((2*a*AppellF1[(1 + m + n)/2, m, 1 + n, (3 + m
+ n)/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2])/(1 + m + n) + (b*AppellF1[1/2 + m/2 + n, m, 1 + 2*n, 3/2 + m
/2 + n, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n)/(1 + m + 2*n)))*Tan[(c
+ d*x)/2]*(-(Sec[(c + d*x)/2]^2*Sin[c + d*x]) + Cos[c + d*x]*Sec[(c + d*x)/2]^2*Tan[(c + d*x)/2])*Tan[c + d*x
]^m + 2*(Cos[c + d*x]*Sec[(c + d*x)/2]^2)^m*Tan[(c + d*x)/2]*(b*n*Cos[c + d*x]*(Sec[(c + d*x)/2]^2)^n*Sin[c +
d*x]^(-1 + n)*((2*a*AppellF1[(1 + m + n)/2, m, 1 + n, (3 + m + n)/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2])
/(1 + m + n) + (b*AppellF1[1/2 + m/2 + n, m, 1 + 2*n, 3/2 + m/2 + n, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*
(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n)/(1 + m + 2*n)) + b*n*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n*((2*a*Appell
F1[(1 + m + n)/2, m, 1 + n, (3 + m + n)/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2])/(1 + m + n) + (b*AppellF1
[1/2 + m/2 + n, m, 1 + 2*n, 3/2 + m/2 + n, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*(Sec[(c + d*x)/2]^2)^n*Sin
[c + d*x]^n)/(1 + m + 2*n))*Tan[(c + d*x)/2] + (a^2*(-(((1 + m)*AppellF1[1 + (1 + m)/2, m, 2, 1 + (3 + m)/2, T
an[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*Sec[(c + d*x)/2]^2*Tan[(c + d*x)/2])/(3 + m)) + (m*(1 + m)*AppellF1[1
+ (1 + m)/2, 1 + m, 1, 1 + (3 + m)/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*Sec[(c + d*x)/2]^2*Tan[(c + d*x
)/2])/(3 + m)))/(1 + m) + b*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n*((b*n*AppellF1[1/2 + m/2 + n, m, 1 + 2*n, 3/
2 + m/2 + n, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*Cos[c + d*x]*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^(-1 + n
))/(1 + m + 2*n) + (b*n*AppellF1[1/2 + m/2 + n, m, 1 + 2*n, 3/2 + m/2 + n, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/
2]^2]*(Sec[(c + d*x)/2]^2)^n*Sin[c + d*x]^n*Tan[(c + d*x)/2])/(1 + m + 2*n) + (b*(Sec[(c + d*x)/2]^2)^n*Sin[c
+ d*x]^n*(-(((1/2 + m/2 + n)*(1 + 2*n)*AppellF1[3/2 + m/2 + n, m, 2 + 2*n, 5/2 + m/2 + n, Tan[(c + d*x)/2]^2,
-Tan[(c + d*x)/2]^2]*Sec[(c + d*x)/2]^2*Tan[(c + d*x)/2])/(3/2 + m/2 + n)) + (m*(1/2 + m/2 + n)*AppellF1[3/2 +
m/2 + n, 1 + m, 1 + 2*n, 5/2 + m/2 + n, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*Sec[(c + d*x)/2]^2*Tan[(c +
d*x)/2])/(3/2 + m/2 + n)))/(1 + m + 2*n) + (2*a*(-(((1 + n)*(1 + m + n)*AppellF1[1 + (1 + m + n)/2, m, 2 + n,
1 + (3 + m + n)/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*Sec[(c + d*x)/2]^2*Tan[(c + d*x)/2])/(3 + m + n))
+ (m*(1 + m + n)*AppellF1[1 + (1 + m + n)/2, 1 + m, 1 + n, 1 + (3 + m + n)/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*
x)/2]^2]*Sec[(c + d*x)/2]^2*Tan[(c + d*x)/2])/(3 + m + n)))/(1 + m + n)))*Tan[c + d*x]^m))
________________________________________________________________________________________
fricas [F] time = 0.53, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (b^{2} \sin \left (d x + c\right )^{2 \, n} + 2 \, a b \sin \left (d x + c\right )^{n} + a^{2}\right )} \tan \left (d x + c\right )^{m}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+b*sin(d*x+c)^n)^2*tan(d*x+c)^m,x, algorithm="fricas")
[Out]
integral((b^2*sin(d*x + c)^(2*n) + 2*a*b*sin(d*x + c)^n + a^2)*tan(d*x + c)^m, x)
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (b \sin \left (d x + c\right )^{n} + a\right )}^{2} \tan \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+b*sin(d*x+c)^n)^2*tan(d*x+c)^m,x, algorithm="giac")
[Out]
integrate((b*sin(d*x + c)^n + a)^2*tan(d*x + c)^m, x)
________________________________________________________________________________________
maple [F(-1)] time = 180.00, size = 0, normalized size = 0.00 \[ \int \left (a +b \left (\sin ^{n}\left (d x +c \right )\right )\right )^{2} \left (\tan ^{m}\left (d x +c \right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((a+b*sin(d*x+c)^n)^2*tan(d*x+c)^m,x)
[Out]
int((a+b*sin(d*x+c)^n)^2*tan(d*x+c)^m,x)
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (b \sin \left (d x + c\right )^{n} + a\right )}^{2} \tan \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+b*sin(d*x+c)^n)^2*tan(d*x+c)^m,x, algorithm="maxima")
[Out]
integrate((b*sin(d*x + c)^n + a)^2*tan(d*x + c)^m, x)
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\mathrm {tan}\left (c+d\,x\right )}^m\,{\left (a+b\,{\sin \left (c+d\,x\right )}^n\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int(tan(c + d*x)^m*(a + b*sin(c + d*x)^n)^2,x)
[Out]
int(tan(c + d*x)^m*(a + b*sin(c + d*x)^n)^2, x)
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sin ^{n}{\left (c + d x \right )}\right )^{2} \tan ^{m}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+b*sin(d*x+c)**n)**2*tan(d*x+c)**m,x)
[Out]
Integral((a + b*sin(c + d*x)**n)**2*tan(c + d*x)**m, x)
________________________________________________________________________________________